package com.imooc.order.exception;

import com.imooc.order.enums.ResultEnum;
import lombok.Data;

/**
 * Description: 订单异常类
 * Project: order <br />
 * ClassName: OrderException <br />
 * Copyright: Copyright (c) 2018 deshang<br />
 *
 * @author Wang Shaopeng
 * @date 2018/12/8 21:43
 * @modifier
 * @modifyContent
 */
@Data
public class OrderException extends RuntimeException {

    private Integer code;

    public OrderException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public OrderException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }
}
